/**
 * 登录模块接口列表
 */
import base from "../base"; // 导入接口域名列表
import axios from "../../http/axios"; // 导入http中创建的axios实例

const login = {
  // 登陆
  loginDate(params){
    return axios.post(`${base.baseUrl}/session_config/addSessionData`,params)
  },
  // 登出
  logOutDate(params){
    return axios.get(`${base.baseUrl}/session_config/deleteSessionData`,{params})
  },
  //登录
  // login(params) {
  //   return axios.post(`${base.baseUrl}/auth/api/login`, params);
  // }
    //登录
    login(params) {
      // axios.defaults.withCredentials = true;
      // return axios.post(`${base.rz_cloud}/auth/api/login/ADMIN`, params);
      return axios.post(`${base.loginBaseUrl}/msa-auth/auth/api/login`, params);
    },
    // 退出登陆
    logOut(){
      return axios.get(`${base.loginBaseUrl}/msa-auth/auth/api/logout`);
    },
    // 获取用户下的厂站
    userCompany(){
      return axios.get(`${base.loginBaseUrl}/msa-auth/permission/api/perm/user/company/useable`);
    },

    // 获取当前用户视图
    userView(){
      return axios.get(`${base.loginBaseUrl}/msa-auth/permission/api/perm/user/view/all`);
    },

    // 根据视图 id 取菜单
    getMenu(params){
      return axios.get(`${base.loginBaseUrl}/msa-auth/permission/api/perm/user/change/view/${params.id}`)
    },

  // YU 修改
  // 密码修改
   changePassword(params) {
    // return axios.put(`${base.loginBaseUrl}/msa-auth/auth/api/login`, params);
    return axios.put(`${base.loginBaseUrl}/msa-permission/permission/api/user/password`, params);
  },

};

export default login;
